package com.ganbo.rabbitmq.delay;

import com.ganbo.mq.common.utils.DateUtil;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.Map;


@Component
@RabbitListener(queues = DelayQueueConfig.TOPIC_DELAY) //配置监听的队列
public class DelayConsumer {

    @RabbitHandler
    public void process(byte[] body) {
        System.out.println(DateUtil.formateDateyyyy_MM_ddHHmmss(new Date()) + "消费者接受到消息=====>" + new String(body));
    }

}
